<!-- Ndas -->
<div class="main-window-segment" style="padding-top: none; padding-bottom: 20px;">
    <div class="container-fluid">
        <div class="row">

            <div class="col-lg-10 col-md-6 col-sm-12">
                <h2>Laporan Deviasi Kanwil</h2>
            </div>
			<div class="col-lg-1 col-md-3 col-sm-12" style="padding-top: 20px;">
<?php
                //----------------------------------------------------
                //Development History.Revisi : 0 Kegiatan :1.mencetak hasil filter ke dalam pdf Dibuat oleh : Rifan Abdul Rachman Tanggal dibuat : 18-07-2014  File yang diubah : test.php  
                
						if (isset($this->d_bulan)) {
							$kdbulan = $this->d_bulan;
						} else {
							$kdbulan = 'SEMUA';
						}
						if (isset($this->d_minggu)) {
							$kdminggu = $this->d_minggu;
						} else {
							$kdminggu = 'SEMUA';
						}
						if (isset($this->d_akun)) {
							$kdakun = $this->d_akun;
						} else {
							$kdakun = 'SEMUA';
						}
						if (Session::get('role') == ADMIN || Session::get('role') == PKN || Session::get('role') == KPPN) {
							if (isset($this->d_kanwil)) {
								$kdkanwil = $this->d_kanwil;
							}else{
								$kdkanwil = 'SEMUA';
							}
							if (isset($this->d_kd_kppn)) {
								$kdkppn = $this->d_kd_kppn;
							}else{
								$kdkppn = 'SEMUA';
							}
							if (isset($this->d_kdsatker)) {
								$kdsatker = $this->d_kdsatker;
							}else{
								$kdsatker = 'SEMUA';
							}							
						}
						if (Session::get('role') == SATKER) {
							if (isset($this->d_kdsatker)) {
								$kdsatker = $this->d_kdsatker;
							}else{
								$kdsatker = Session::get('kd_satker');
							}
							if (isset($this->d_kanwil)) {
								$kdkanwil = $this->d_kanwil;
							}else{
								$kdkanwil = 'SEMUA';
							}
							if (isset($this->d_kd_kppn)) {
								$kdkppn = $this->d_kd_kppn;
							}else{
								$kdkppn = 'SEMUA';
							}
						}


						?>
                <div class="btn-group-sm">
                    <button type="button" class="btn btn-default dropdown-toggle fullwidth" data-toggle="dropdown" aria-expanded="false"><span class="glyphicon glyphicon-print"></span>&nbsp; Cetak <span class="caret"></span>
                    </button>
                          <ul class="dropdown-menu" role="menu">
                            <li><a href="<?php echo URL; ?>PDF/rekapRPDAkurasiKanwil_PDF/<?php echo $kdbulan . "/" . $kdkanwil; ?>/PDF">PDF</a></li>
                            <li><a href="<?php echo URL; ?>PDF/rekapRPDAkurasiKanwil_PDF/<?php echo $kdbulan . "/" . $kdkanwil; ?>/XLS">EXCEL</a></li>
                          </ul>
                </div>
						
						<?php
						//----------------------------------------------------		
					
              ?>
            </div>
            <div class="col-lg-1 col-md-3 col-sm-12" style="padding-top: 20px;">

                <button type="button" style="width: 100%" class="btn btn-default" data-toggle="modal" data-target="#modal-app-filter"><span class="glyphicon glyphicon-filter"></span> Filter</button>

            </div>
            
        </div>
        
        

        <div class="row" style="padding-top: 10px">

            <div class="col-md-6 col-sm-12">
                <?php
                if (isset($this->d_bulan)) {
                    echo "Bulan : ".Tanggal::bulan_indo($this->d_bulan);
                }
                if (isset($this->d_kanwil)) {
                    foreach ($this->d_nama_kanwil as $kanwil) {
                        echo "<br/>Kanwil : ".$kanwil->get_nama_user() . " (" . substr($kanwil->get_kd_satker(),1,2) . ")";
                        $kode_kanwil = $kanwil->get_kd_satker();
                    }
                }
                ?>
            </div>

            <div class="col-md-6 col-sm-12" style="text-align: right;">
                <?php
                echo "<i>(Data dalam jutaan Rupiah)</i><br>";
                // untuk menampilkan last_update
                if (isset($this->last_update)) {
                    foreach ($this->last_update as $last_update) {
                        echo "Update Data Terakhir (Waktu Server)<br/>" . $last_update->get_last_update() . " WIB";
                    }
                }
                
                ?>
            </div>

        </div>

    </div>
</div>
<?php 
if ($this->d_minggu==1){$tambah_hari = 0;}
elseif ($this->d_minggu==2){$tambah_hari = 7;}
elseif ($this->d_minggu==3){$tambah_hari = 15;}
elseif ($this->d_minggu==4){$tambah_hari = 23;}
?>
<!-- Tabel -->
<div id="table-container" class="wrapper">
    <table class="table table-bordered">
        <!--baris pertama-->
        <thead>
            <tr>
                <th rowspan = '2'>No.</th>
                <th rowspan = '2'>KPPN</th>
                <th>1</th>
                <th>2</th>
                <th>3</th>
                <th>4</th>
                <th>5</th>
                <th>6</th>
                <th>7</th>
                <th>8</th>
                <th>9</th>
                <th>10</th>
                <th>11</th>
                <th>12</th>
                <th>13</th>
                <th>14</th>
                <th>15</th>
                <th>16</th>
                <th>17</th>
                <th>18</th>
                <th>19</th>
                <th>20</th>
                <th>21</th>
                <th>22</th>
                <th>23</th>
                <th>24</th>
                <th>25</th>
                <th>26</th>
                <th>27</th>
                <th>28</th>
                <th>29</th>
                <th>30</th>
                <th>31</th>
            </tr>
            <tr>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
                <th>Dev(%)</th>
            </tr>
        </thead>
        <tbody class='align-right'>
            <?php
            $no = 1;
            $total_rpd1 ;
            $total_rpd2 ;
            $total_rpd3 ;
            $total_rpd4 ;
            $total_rpd5 ;
            $total_rpd6 ;
            $total_rpd7 ;
            $total_rpd8 ;
            $total_rpd9 ;
            $total_rpd10 ;
            $total_rpd11 ;
            $total_rpd12 ;
            $total_rpd13 ;
            $total_rpd14 ;
            $total_rpd15 ;
            $total_rpd16 ;
            $total_rpd17 ;
            $total_rpd18 ;
            $total_rpd19 ;
            $total_rpd20 ;
            $total_rpd21 ;
            $total_rpd22 ;
            $total_rpd23 ;
            $total_rpd24 ;
            $total_rpd25 ;
            $total_rpd26 ;
            $total_rpd27 ;
            $total_rpd28 ;
            $total_rpd29 ;
            $total_rpd30 ;
            $total_rpd31 ;
            if (isset($this->data)) {
                if (empty($this->data)) {
                    echo '<td colspan=12 align="center">Tidak ada data.</td>';
                } else {
                    $jumlah_deviasi1=0;$munculnya_deviasi1=0;
                    $jumlah_deviasi2=0;$munculnya_deviasi2=0;
                    $jumlah_deviasi3=0;$munculnya_deviasi3=0;
                    $jumlah_deviasi4=0;$munculnya_deviasi4=0;
                    $jumlah_deviasi5=0;$munculnya_deviasi5=0;
                    $jumlah_deviasi6=0;$munculnya_deviasi6=0;
                    $jumlah_deviasi7=0;$munculnya_deviasi7=0;
                    $jumlah_deviasi8=0;$munculnya_deviasi8=0;
                    $jumlah_deviasi9=0;$munculnya_deviasi9=0;
                    $jumlah_deviasi10=0;$munculnya_deviasi10=0;
                    $jumlah_deviasi11=0;$munculnya_deviasi11=0;
                    $jumlah_deviasi12=0;$munculnya_deviasi12=0;
                    $jumlah_deviasi13=0;$munculnya_deviasi13=0;
                    $jumlah_deviasi14=0;$munculnya_deviasi14=0;
                    $jumlah_deviasi15=0;$munculnya_deviasi15=0;
                    $jumlah_deviasi16=0;$munculnya_deviasi16=0;
                    $jumlah_deviasi17=0;$munculnya_deviasi17=0;
                    $jumlah_deviasi18=0;$munculnya_deviasi18=0;
                    $jumlah_deviasi19=0;$munculnya_deviasi19=0;
                    $jumlah_deviasi20=0;$munculnya_deviasi20=0;
                    $jumlah_deviasi21=0;$munculnya_deviasi21=0;
                    $jumlah_deviasi22=0;$munculnya_deviasi22=0;
                    $jumlah_deviasi23=0;$munculnya_deviasi23=0;
                    $jumlah_deviasi24=0;$munculnya_deviasi24=0;
                    $jumlah_deviasi25=0;$munculnya_deviasi25=0;
                    $jumlah_deviasi26=0;$munculnya_deviasi26=0;
                    $jumlah_deviasi27=0;$munculnya_deviasi27=0;
                    $jumlah_deviasi28=0;$munculnya_deviasi28=0;
                    $jumlah_deviasi29=0;$munculnya_deviasi29=0;
                    $jumlah_deviasi30=0;$munculnya_deviasi30=0;
                    $jumlah_deviasi31=0;$munculnya_deviasi31=0;
                    foreach ($this->data as $value) {
                        echo "<tr>	";
                        echo "<td class='align-center'>" . $no++ . "</td>";
                        echo "<td class='align-left'><a href='".URL."dataRPD/rekapRPDAkurasiKPPN/".$this->d_bulan."/".$value->get_kdkppn()."'>" . $value->get_kdkppn() . " <br/> ".$value->get_nmkppn()."</a></td>";
                        if(is_null($value->get_rpd_1())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_1(),2,",",".")."</td>";
                            $jumlah_deviasi1+=$value->get_rpd_1();
                            $munculnya_deviasi1++;
                        }
                        
                        if(is_null($value->get_rpd_2())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_2(),2,",",".")."</td>";
                            $jumlah_deviasi2+=$value->get_rpd_2();
                            $munculnya_deviasi2++;
                        }
                        
                        if(is_null($value->get_rpd_3())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_3(),2,",",".")."</td>";
                            $jumlah_deviasi3+=$value->get_rpd_3();
                            $munculnya_deviasi3++;
                        }
                        
                        if(is_null($value->get_rpd_4())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_4(),2,",",".")."</td>";
                            $jumlah_deviasi4+=$value->get_rpd_4();
                            $munculnya_deviasi4++;
                        }
                        
                        if(is_null($value->get_rpd_5())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_5(),2,",",".")."</td>";
                            $jumlah_deviasi5+=$value->get_rpd_5();
                            $munculnya_deviasi5++;
                        }
                        
                        if(is_null($value->get_rpd_6())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_6(),2,",",".")."</td>";
                            $jumlah_deviasi6+=$value->get_rpd_6();
                            $munculnya_deviasi6++;
                        }
                        
                        if(is_null($value->get_rpd_7())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_7(),2,",",".")."</td>";
                            $jumlah_deviasi7+=$value->get_rpd_7();
                            $munculnya_deviasi7++;
                        }
                        
                        if(is_null($value->get_rpd_8())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_8(),2,",",".")."</td>";
                            $jumlah_deviasi8+=$value->get_rpd_8();
                            $munculnya_deviasi8++;
                        }
                        
                        if(is_null($value->get_rpd_9())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_9(),2,",",".")."</td>";
                            $jumlah_deviasi9+=$value->get_rpd_9();
                            $munculnya_deviasi9++;
                        }
                        
                        if(is_null($value->get_rpd_10())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_10(),2,",",".")."</td>";
                            $jumlah_deviasi10+=$value->get_rpd_10();
                            $munculnya_deviasi10++;
                        }
                        
                        if(is_null($value->get_rpd_11())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_11(),2,",",".")."</td>";
                            $jumlah_deviasi11+=$value->get_rpd_11();
                            $munculnya_deviasi11++;
                        }
                        
                        if(is_null($value->get_rpd_12())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_12(),2,",",".")."</td>";
                            $jumlah_deviasi12+=$value->get_rpd_12();
                            $munculnya_deviasi12++;
                        }
                        
                        if(is_null($value->get_rpd_13())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_13(),2,",",".")."</td>";
                            $jumlah_deviasi13+=$value->get_rpd_13();
                            $munculnya_deviasi13++;
                        }
                        
                        if(is_null($value->get_rpd_14())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_14(),2,",",".")."</td>";
                            $jumlah_deviasi14+=$value->get_rpd_14();
                            $munculnya_deviasi14++;
                        }
                        
                        if(is_null($value->get_rpd_15())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_15(),2,",",".")."</td>";
                            $jumlah_deviasi15+=$value->get_rpd_15();
                            $munculnya_deviasi15++;
                        }
                        
                        if(is_null($value->get_rpd_16())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_16(),2,",",".")."</td>";
                            $jumlah_deviasi16+=$value->get_rpd_16();
                            $munculnya_deviasi16++;
                        }
                        
                        if(is_null($value->get_rpd_17())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_17(),2,",",".")."</td>";
                            $jumlah_deviasi17+=$value->get_rpd_17();
                            $munculnya_deviasi17++;
                        }
                        
                        if(is_null($value->get_rpd_18())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_18(),2,",",".")."</td>";
                            $jumlah_deviasi18+=$value->get_rpd_18();
                            $munculnya_deviasi18++;
                        }
                        
                        if(is_null($value->get_rpd_19())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_19(),2,",",".")."</td>";
                            $jumlah_deviasi19+=$value->get_rpd_19();
                            $munculnya_deviasi19++;
                        }
                        
                        if(is_null($value->get_rpd_20())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_20(),2,",",".")."</td>";
                            $jumlah_deviasi20+=$value->get_rpd_20();
                            $munculnya_deviasi20++;
                        }
                        if(is_null($value->get_rpd_21())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_21(),2,",",".")."</td>";
                            $jumlah_deviasi21+=$value->get_rpd_21();
                            $munculnya_deviasi21++;
                        }
                        
                        if(is_null($value->get_rpd_22())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_22(),2,",",".")."</td>";
                            $jumlah_deviasi22+=$value->get_rpd_22();
                            $munculnya_deviasi22++;
                        }
                        
                        if(is_null($value->get_rpd_23())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_23(),2,",",".")."</td>";
                            $jumlah_deviasi23+=$value->get_rpd_23();
                            $munculnya_deviasi23++;
                        }
                        
                        if(is_null($value->get_rpd_24())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_24(),2,",",".")."</td>";
                            $jumlah_deviasi24+=$value->get_rpd_24();
                            $munculnya_deviasi24++;
                        }
                        
                        if(is_null($value->get_rpd_25())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_25(),2,",",".")."</td>";
                            $jumlah_deviasi25+=$value->get_rpd_25();
                            $munculnya_deviasi25++;
                        }
                        
                        if(is_null($value->get_rpd_26())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_26(),2,",",".")."</td>";
                            $jumlah_deviasi26+=$value->get_rpd_26();
                            $munculnya_deviasi26++;
                        }
                        
                        if(is_null($value->get_rpd_27())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_27(),2,",",".")."</td>";
                            $jumlah_deviasi27+=$value->get_rpd_27();
                            $munculnya_deviasi27++;
                        }
                        
                        if(is_null($value->get_rpd_28())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_28(),2,",",".")."</td>";
                            $jumlah_deviasi28+=$value->get_rpd_28();
                            $munculnya_deviasi28++;
                        }
                        
                        if(is_null($value->get_rpd_29())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_29(),2,",",".")."</td>";
                            $jumlah_deviasi29+=$value->get_rpd_29();
                            $munculnya_deviasi29++;
                        }
                        
                        if(is_null($value->get_rpd_30())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_30(),2,",",".")."</td>";
                            $jumlah_deviasi30+=$value->get_rpd_30();
                            $munculnya_deviasi30++;
                        }
                        
                        if(is_null($value->get_rpd_31())){
                            echo  "<td bgcolor='#8ED6FF'>-</td>";
                        } else {
                            echo "<td>" . number_format($value->get_rpd_31(),2,",",".")."</td>";
                            $jumlah_deviasi31+=$value->get_rpd_31();
                            $munculnya_deviasi31++;
                        }
                        echo "</tr>	";  
                    }
                }
            } else {
                echo '<td colspan=12 align="center" id="filter-first">Silahkan masukkan filter terlebih dahulu.</td>';
            }
            ?>
        </tbody>
        <?php if (isset($this->data)) {
                if (!empty($this->data)) { ?>
        <tfoot>
            <tr>
                <td colspan="2" align="right">Deviasi Kanwil (%)</td>
                    <?php 
                        if ($munculnya_deviasi1>0){
                            $total_rpd1=$jumlah_deviasi1/$munculnya_deviasi1;
                            echo "<td>".number_format($total_rpd1,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi2>0){
                            $total_rpd2=$jumlah_deviasi2/$munculnya_deviasi2;
                            echo "<td>".number_format($total_rpd2,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi3>0){
                            $total_rpd3=$jumlah_deviasi3/$munculnya_deviasi3;
                            echo "<td>".number_format($total_rpd3,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi4>0){
                            $total_rpd4=$jumlah_deviasi4/$munculnya_deviasi4;
                            echo "<td>".number_format($total_rpd4,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi5>0){
                            $total_rpd5=$jumlah_deviasi5/$munculnya_deviasi5;
                            echo "<td>".number_format($total_rpd5,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi6>0){
                            $total_rpd6=$jumlah_deviasi6/$munculnya_deviasi6;
                            echo "<td>".number_format($total_rpd6,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi7>0){
                            $total_rpd7=$jumlah_deviasi7/$munculnya_deviasi7;
                            echo "<td>".number_format($total_rpd7,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi8>0){
                            $total_rpd8=$jumlah_deviasi8/$munculnya_deviasi8;
                            echo "<td>".number_format($total_rpd8,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi9>0){
                            $total_rpd9=$jumlah_deviasi9/$munculnya_deviasi9;
                            echo "<td>".number_format($total_rpd9,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi10>0){
                            $total_rpd10=$jumlah_deviasi10/$munculnya_deviasi10;
                            echo "<td>".number_format($total_rpd10,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi11>0){
                            $total_rpd11=$jumlah_deviasi11/$munculnya_deviasi11;
                            echo "<td>".number_format($total_rpd11,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi12>0){
                            $total_rpd12=$jumlah_deviasi12/$munculnya_deviasi12;
                            echo "<td>".number_format($total_rpd12,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi13>0){
                            $total_rpd13=$jumlah_deviasi13/$munculnya_deviasi13;
                            echo "<td>".number_format($total_rpd13,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi14>0){
                            $total_rpd14=$jumlah_deviasi14/$munculnya_deviasi14;
                            echo "<td>".number_format($total_rpd14,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi15>0){
                            $total_rpd15=$jumlah_deviasi15/$munculnya_deviasi15;
                            echo "<td>".number_format($total_rpd15,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi16>0){
                            $total_rpd16=$jumlah_deviasi16/$munculnya_deviasi16;
                            echo "<td>".number_format($total_rpd16,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi17>0){
                            $total_rpd17=$jumlah_deviasi17/$munculnya_deviasi17;
                            echo "<td>".number_format($total_rpd17,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi18>0){
                            $total_rpd18=$jumlah_deviasi18/$munculnya_deviasi18;
                            echo "<td>".number_format($total_rpd18,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi19>0){
                            $total_rpd19=$jumlah_deviasi19/$munculnya_deviasi19;
                            echo "<td>".number_format($total_rpd19,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi20>0){
                            $total_rpd20=$jumlah_deviasi20/$munculnya_deviasi20;
                            echo "<td>".number_format($total_rpd20,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi21>0){
                            $total_rpd21=$jumlah_deviasi21/$munculnya_deviasi21;
                            echo "<td>".number_format($total_rpd21,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi22>0){
                            $total_rpd22=$jumlah_deviasi22/$munculnya_deviasi22;
                            echo "<td>".number_format($total_rpd22,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi23>0){
                            $total_rpd23=$jumlah_deviasi23/$munculnya_deviasi23;
                            echo "<td>".number_format($total_rpd23,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi24>0){
                            $total_rpd24=$jumlah_deviasi24/$munculnya_deviasi24;
                            echo "<td>".number_format($total_rpd24,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi25>0){
                            $total_rpd25=$jumlah_deviasi25/$munculnya_deviasi25;
                            echo "<td>".number_format($total_rpd25,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi26>0){
                            $total_rpd26=$jumlah_deviasi26/$munculnya_deviasi26;
                            echo "<td>".number_format($total_rpd26,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi27>0){
                            $total_rpd27=$jumlah_deviasi27/$munculnya_deviasi27;
                            echo "<td>".number_format($total_rpd27,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi28>0){
                            $total_rpd28=$jumlah_deviasi28/$munculnya_deviasi28;
                            echo "<td>".number_format($total_rpd28,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi29>0){
                            $total_rpd29=$jumlah_deviasi29/$munculnya_deviasi29;
                            echo "<td>".number_format($total_rpd29,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi30>0){
                            $total_rpd30=$jumlah_deviasi30/$munculnya_deviasi30;
                            echo "<td>".number_format($total_rpd30,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
                    <?php 
                        if ($munculnya_deviasi31>0){
                            $total_rpd31=$jumlah_deviasi31/$munculnya_deviasi31;
                            echo "<td>".number_format($total_rpd31,2,",",".")."</td>";
                        } else {
                            echo "<td bgcolor='#8ED6FF'>-</td>"; 
                        }
                    ?>
            </tr>
        </tfoot>
        <?php } 
            }?>
    </table>
</div>

<!-- Filter -->
<div class="modal fade" id="modal-app-filter" tabindex="-1" role="dialog" aria-labelledby="app-filter-label" aria-hidden="true">

    <div class="modal-dialog">

        <div class="modal-content">

            <div class="modal-header">

                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Tutup</span></button>
                <h4 class="modal-title" id="app-filter-label"><span class="glyphicon glyphicon-filter"></span> Filter Data</h4>

            </div>

            <form id="filter-form" method="POST" action=<?php echo URL."dataRPD/rekapRPDAkurasiKanwil" ?> enctype="multipart/form-data">

                <div class="modal-body">

                    <!-- Paste Isi Fom mulai nangkene -->
                    <div>
                        <div>
                        <div id="wbulan" class='alert alert-danger' style='display:none;'></div>
                        <label class="isian">Bulan: </label>
                        <select class="form-control" type="text" name="bulan" id="bulan">
                        <option value='01' <?php if ($this->d_bulan == '01') {
    echo "selected";
} ?> >Januari</option>
                        <option value='02' <?php if ($this->d_bulan == '02') {
    echo "selected";
} ?> >Februari</option>
                        <option value='03' <?php if ($this->d_bulan == '03') {
    echo "selected";
} ?> >Maret</option>
                        <option value='04' <?php if ($this->d_bulan == '04') {
    echo "selected";
} ?> >April</option>
                        <option value='05' <?php if ($this->d_bulan == '05') {
    echo "selected";
} ?> >Mei</option>
                        <option value='06' <?php if ($this->d_bulan == '06') {
    echo "selected";
} ?> >Juni</option>
                        <option value='07' <?php if ($this->d_bulan == '07') {
    echo "selected";
} ?> >Juli</option>
                        <option value='08' <?php if ($this->d_bulan == '08') {
    echo "selected";
} ?> >Agustus</option>
                        <option value='09' <?php if ($this->d_bulan == '09') {
    echo "selected";
} ?> >September</option>
                        <option value='10' <?php if ($this->d_bulan == '10') {
    echo "selected";
} ?> >Oktober</option>
                        <option value='11' <?php if ($this->d_bulan == '11') {
    echo "selected";
} ?> >November</option>
                        <option value='12' <?php if ($this->d_bulan == '12') {
    echo "selected";
} ?> >Desember</option>
                    </select>
                </div>
                    <?php if (isset($this->kanwil_list)) { ?>
                        <br/>
                        <div id="wkdkanwil" class='alert alert-danger' style='display:none;'></div>
                        <label class="isian">Kode Kanwil: </label>
                        <select class="form-control" type="text" name="kdkanwil" id="kdkanwil">
                            <?php
                            foreach ($this->kanwil_list as $value2) {
                                if ($this->d_kanwil == $value2->get_kd_d_kppn()) {
                                    echo "<option value='" . $value2->get_kd_d_kppn() . "' selected>" . $value2->get_kd_d_kppn() . " | " . $value2->get_nama_user() . "</option>";
                                } else {
                                    echo "<option value='" . $value2->get_kd_d_kppn() . "'>" . $value2->get_kd_d_kppn() . " | " . $value2->get_nama_user() . "</option>";
                                }
                            }
                            ?>
                        </select>
                    <?php } ?>
                </div>
                </div>
                <div class="modal-footer">
                    <button type="submit" name="submit_file" class="btn btn-primary" style="width: 100%" onClick="return cek_upload()">Kirim</button>
                </div>

            </form>

        </div>

    </div>
<div class="main-window-segment vertical-padded">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12">
                Pertanyaan menu RPD harap menghubungi PIC Direktorat PKN :</br>
                1. Zakaria, HP : 085226950999, email : zacky.469@gmail.com<br>
                2. Tri Angga Sigit, HP : 081410109462, Email : hanif643@gmail.com
            </div>

        </div>
    </div>
</div>

</div>